package com.czkt.springboot_mybatis_test.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.czkt.springboot_mybatis_test.entity.SysRole;
import com.czkt.springboot_mybatis_test.entity.SysUser;
import com.czkt.springboot_mybatis_test.entity.vo.UserRole;
import com.czkt.springboot_mybatis_test.mapper.SysUserMapper;
import com.czkt.springboot_mybatis_test.service.ISysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jobob
 * @since 2024-06-18
 */
@Service
public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> implements ISysUserService {
    @Resource
    private SysUserMapper sysUserMapper;

    @Override
    public UserRole selectSysUser(String usrName, String usrPassword) {
        return sysUserMapper.selectSysUser(usrName, usrPassword);
    }

    @Override
    public UserRole selectRoleUser(String usrName) {
        return sysUserMapper.selectRoleUser(usrName);
    }

    @Override
    public List<UserRole> selectSysUserAndRole(String usrName, String roleId, Integer pageIndex, Integer pageSize) {
        return sysUserMapper.selectSysUserAndRole(usrName, roleId, pageIndex, pageSize);
    }

    @Override
    public UserRole selectUsrId(String usrId) {
        return sysUserMapper.selectUsrId(usrId);
    }

    @Override
    public void toUpdateUser(SysUser sysUser) {
        sysUserMapper.toUpdateUser(sysUser);
    }

    @Override
    public void deleteByUsrId(String usrId) {
        sysUserMapper.deleteByUsrId(usrId);
    }

    @Override
    public void toInsertUser(SysUser sysUser) {
        sysUserMapper.toInsertUser(sysUser);
    }

}
